%% Background Estimation Methods

function para = Background_Estimate(subtype,a)
    if(strcmp(subtype,'GAUSSIAN'))
        para = Gaussian_Est(a);
    end
end

%%Gaussian BackGround parameter estimation
function para = Gaussian_Est(a)

    a = double(a);
    a_size = size(a);
    para = zeros(a_size(1),a_size(2),2);
    for i = 1:a_size(1)
        for j = 1:a_size(2)
            u_ML = mean(a(i,j,:));
            tmp_data = a(i,j,:)-u_ML;
            sig_ML = mean(tmp_data.^2);
            para(i,j,1) = u_ML;
            para(i,j,2) = sig_ML;
        end
    end

end